class Navigation extends React.Component{
    render() {
        return (
            <Navigator
                initialRoute={{name: 'My First Scene', index: 0}}
                renderScene={(route, navigator) =>
                <MySceneComponent
                    name={route.name}
                    onForward={() => {
                    var nextIndex = route.index + 1;
                    navigator.push({
                        name: 'Scene ' + nextIndex,
                        index: nextIndex,
                    });
                    }}
                    onBack={() => {
                    if (route.index > 0) {
                        navigator.pop();
                    }
                    }}
                />
                }
            />
        );
    }
    
    navigatorRenderScene(route, navigator) {
        _navigator = navigator;
        
        switch (route.id) {
            case 'first':
                return (<First navigator={navigator} title="first"/>);
            case 'second':
                return (<Second navigator={navigator} title="second" />);
        }
    }
}